home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 6 / The Arsenal Files 6 (Arsenal Computer).ISO / os2 / kmmepm03.zip / KENMMEPM.DOC < prev    next >
Text File  |  1996-03-07  |  10KB  |  164 lines

  1. (Note:  this file has been enhanced for EPM.  For best results, use Info-Zip to 
  2. unpack the zipfile, which will save the extended attributes, and use black type on a 
  3. light grey background in EPM.)
  4.  
  5.                                       kenMMepm
  6.  
  7.     Thanks for trying this EPM extension!
  8.  
  9. Overview     
  10.      kenMMepm adds the ability to quickly select the name of a multi-media file
  11. (or Internet URL) embedded in a text file and automatically launch the appropriate 
  12. application for viewing/listening to/accessing that file.  
  13.  
  14.      The file name can be selected by either of two methods:
  15.      1.  The easiest way is to simply put the cursor anywhere within the filename 
  16. and select the "MMedia" menu item.  The EPM macro will automatically find the 
  17. beginning and end of the filename and then launch an application for viewing the 
  18. file.  (Note:  don't be alarmed when you see a locate circle appear and the cursor 
  19. jump to another line.  Be patient, and the cursor will return to the original line 
  20. after a few seconds.) 
  21.     2. Use a character mark to highlight the name of the file, and then select the
  22. "MMedia" menu item to automatically launch an application for displaying the file.
  23. This is the method to use if the filename (or URL) has embedded spaces or funky
  24. characters in it.
  25.  
  26. How it works
  27.     kenMMepm stores the fully qualified name (including the extension) of the
  28. selected file name in a variable called "dataname", and also stores the extension in
  29. a variable called "DataExt".  The messageline at the bottom of EPM will keep you
  30. informed of what kenMMepm is using as the "dataname".  
  31.     kenMMepm will first examine "dataname" to see if it's a URL and, if so, will
  32. strip off the beginning of the URL ("gopher://", "telnet://", etc.)  when appropriate
  33. and then launch an Internet app, passing the "dataname" to the app.
  34.      Next, kenMMepm checks to see if "dataname" includes the "@" symbol.  If it does,
  35. the "mailto:" phrase is added to the beginning of it, and WebEx is called for sending 
  36. mail.
  37.     If "dataname" isn't a URL, kenMMepm will then look at "DataExt" and, based on the
  38. extension (and the configuration you previously set), it launches an application and
  39. passes the file name to that app for processing.  The application can be a viewer
  40. (for images) an audio player, a spreadsheet program, etc.
  41.  
  42. Getting Started
  43.      Requirements:  You'll need a version of EPM above 6, and most likely it'll have 
  44. to be at least 6.03a.  This is the version I used when writing & testing the code.
  45.      Configuring the extension:  This is a three-step process:  writing the names of 
  46. your applications into the kenMMepm.e file; compiling that file into a kenMMepm.ex 
  47. file; and linking kenMMepm.ex into your copy of EPM. 
  48.  
  49.      Adding your applications
  50.     If you're unfamiliar with the E macro language, there's plenty of info available
  51. in the EPMUSERS.INF and EPMTECH.INF references.  For our purposes here, you need to
  52. know that putting a semi-colon in the first column of a line makes that line a
  53. comment and it's ignored.  (You can see an example of this in kenMMepm.e where I've
  54. "commented out" a few lines that refer to the Windows apps on my system.)  Also, any
  55. literal string you want to be passed to the application (or to OS/2) must be enclosed
  56. in quotes.
  57.      The only section of kenMMepm.e that you'll need to deal with is near the
  58. beginning -- all those "elseif...then" statements.  
  59.  
  60.      Internet apps
  61.     For example, let's look at the lines that launch FTPPM:
  62.    elseif upcase(leftstr(dataname, 6))='FTP://' then
  63.       dataname=substr(dataname, 7)  -- this line strips out the URL type
  64.       'start /F linkup.exe ftppm.exe' dataname' anonymous name@address'
  65.     You don't have to do anything to the first line (the "elseif" one).  This line is
  66. what figures out what type of URL it's dealing with.  The second line is the line
  67. that strips out the "ftp://" at the beginning of the URL, because FTPPM doesn't use
  68. that part.  If you prefer to use WebEx for FTP (or Gopher, etc.)  you'll have to
  69. "comment out" lines like this one.  The third line launches the application, and it's
  70. in here that you'll need to replace the application name (if necessary) with the app
  71. you prefer to use.  Make sure to preserve the spaces, since these are what separate
  72. the arguments that are passed to the application.  Use your own password, of course
  73. (and remove the ' anonymous name@address' part entirely if you're using WebEx for 
  74. FTP). You can go through the rest of the Internet section and make the changes you 
  75. want for your setup.  You'll notice that I've used WebEx for newsgroups because it 
  76. allows you to designate & read a specific newsgroup, even though you aren't 
  77. subscribed to it.  I'm also using WebEx for sending mail, since it's real easy. <G>
  78.  
  79.      Other apps
  80.      The next section of kenMMepm.e sets up your other apps for viewing images, 
  81. listening to sounds, etc.  Let's look at the lines that launch an image viewer:
  82.    elseif pos(DataExt, 'GIF JPG BMP TIF') then
  83.       'start /F e:\os2apps\showgif.exe' dataname
  84.     The first line looks to see if the "DataExt" also appears in the character string
  85. 'GIF JPG BMP TIF'.  This saves space, since you don't have to list a separate "elseif
  86. DataExt='GIF'", etc., line for every possible file extension, as is done later in
  87. this section.  Just add your file extensions where appropriate (using all upper case)
  88. and change the application in the 'start ...'  line to suit your purposes.  You can
  89. (and probably will) need to add more lines.  Follow these examples and use the
  90. "elseif ...  then" construct, adding your lines before the indicated end of the "user
  91. changes" section.
  92.  
  93.      Compiling the macro
  94.      Use the ETPM.EXE program supplied with EPM.  The syntax is 
  95.      etpm <source directory>\kenMMepm.e <target directory>\kenMMepm.ex
  96. Use the same directory the other EPM *.ex files are in as your target directory.
  97.  
  98.      Linking the macro
  99.      There are a few different ways to do it:
  100.      1.  Bring up an EPM command line and enter:
  101.           link kenMMepm.ex
  102. This will add the "MMedia" item to the main menu bar.
  103.                                          or
  104.      2.  If you're using a PROFILE.ERX, and want kenMMepm loaded when you start 
  105. EPM, add the following line to PROFILE.ERX (the quotes are necessary):
  106.           'link kenMMepm.ex'
  107.                                          or
  108.      3.  If you've been re-compiling the main EPM macros to add your customizations, 
  109. add the following line to your MYSTUFF.E file (quotes are necessary):
  110.           'link kenMMepm.ex'
  111.  
  112.     If you want to remove the macro, at an EPM command line enter:
  113.           unlink kenMMepm.ex
  114. That will remove the functionality of the macro and, in most cases, also remove the 
  115. "MMedia" item from the menu bar.
  116.  
  117.                          That's all there is to it!  Enjoy!
  118.              Send any comments, criticisms or suggestions to:
  119.                                     arway@wwa.com
  120.  
  121. General Hints and Tips
  122.      FTP:  I haven't found a way to pass subdirectories to FTPPM.EXE.  (I doubt that 
  123. it's possible.)  The workarounds, if your URL is something like: 
  124. "ftp://ftp-os2.nmsu.edu/incoming" is to either 1) use the character mark method to 
  125. highlight only the "ftp://ftp-os2.nmsu.edu" part and copy & paste the rest into 
  126. FTPPM's remote directory field once logged in; or 2) change the configuration in 
  127. kenMMepm.e to use WebEx as your FTP app.
  128.      Gopher:  GOPHER.EXE only uses the host name as a starting parameter.  Therefore,
  129. if you've got a long string of sub-menus, try splitting the URL after the host name 
  130. with a space and the numeral "1" and using the character marking method to select 
  131. the whole thing.  For example: 
  132. Original URL:
  133. gopher://wx.atmos.uiuc.edu/Images/Satellite Images/Big North America (GOES8 VIS)
  134. After modifying:
  135. gopher://wx.atmos.uiuc.edu 1/Images/Satellite Images/Big North America (GOES8 VIS)
  136.  
  137. Tips for Power Users
  138.      If you know what you're doing and want the ultimate in convenience <G>, you can 
  139. add the "MMedia" item to the mouse popup menus instead of to the main menu bar.
  140.      First, you'll need to "comment out" several sections of code in kenMMepm.e:
  141.           The three lines of the "const" section, the six lines of the "definit" 
  142.           section, and the four lines of the "defexit" section.
  143.     Second, add the two constants (KMM_MENU_MSG and KMM_MENUP_MSG) from kenMMepm.e to
  144. your MYCNF.E file.
  145.      Third, add the following two lines to your MOUSE.E file:
  146.       buildmenuitem menuname, 80, 8017, \0,                               '',          4, 0
  147.       buildmenuitem menuname, 80, 8026, KMM_MENU_MSG, 'get_dataname'KMM_MENUP_MSG, 0, mpfrom2short(0, 0)
  148.     Those lines go in four places (starting somewhere around line 1128 of MOUSE.E):
  149. in the "if filename = .tree" section, in the "Build inside-mark pop-up", the "Build
  150. outside-mark pop-up", and the "Build no-mark pop-up" sections.  The first line of
  151. code shown above creates a separator line across the popup menu.  Depending on where
  152. you want to place the "MMedia" menu item, if you need the separator line below the
  153. "MMedia" item just transpose those two lines.  Double check to be sure the submenu
  154. IDs (8017 and 8026) are unique for the popup section you're adding 'em to (you'll
  155. definitely have to change the IDs for the "if filename = .tree" section).  Then
  156. re-compile your main E macros.
  157.  
  158.      DISCLAIMER:  This program is supplied "as is", with no guarantee as to its
  159. appropriateness, suitability or functionality.  Use entirely at your own risk.  Under
  160.   no circumstances whatsoever will I be liable in any way for any damages, real or
  161.                          imagined, from use of this program.
  162.                               Copyright Ken Arway 1996
  163.  
  164.